package kr.cafedev.hangul;

import android.content.Context;
import android.media.SoundPool;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.widget.Gallery;

public class MyGallery extends Gallery {
	
	public SoundPool sndpool;
	public int sound;

	public MyGallery(Context context, AttributeSet attrs) {
		super(context, attrs);
		//sndpool = new SoundPool(3, AudioManager.STREAM_MUSIC, 0 );
	}


	@Override
	public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
		
		
		int keyCode;
		if(e2.getX() > e1.getX()){
			keyCode = KeyEvent.KEYCODE_DPAD_LEFT;
		}
		else{
			keyCode = KeyEvent.KEYCODE_DPAD_RIGHT;
		}
		//sndpool.play(sound, 1, 1, 0, 0, 1);
		onKeyDown(keyCode, null);
		
		return true;
	}
}

